<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>

</head>
<body>
<form class="form-horizontal" role="form" id="form">
    <div class="form-group">
        <label for="code" class="col-sm-2 control-label" style="padding: 0px">编码</label>
        <div class="col-sm-10">
            <div id="code" name="name[code]" qtype="2" class="cc-Text" required="true"   nameCn="用户名" style="width:280px;height:30px;"  inputStyle="color:red;font-style:bold"   initValue="" data-options=""   remark="由6-10位字母和数字组成"></div>
        </div>
    </div>
    <div class="form-group" >
        <label for="name" class="col-sm-2 control-label" style="padding: 0px">用户名</label>
        <div class="col-sm-10">
            <div id="name" name="name[value]" qtype="2"  initValue="xx" class="cc-Text" nameCn="用户名" style="width:280px;height:30px;"  required="true"  inputStyle="color:red;font-style:bold"   initValue="" data-options=""   remark="由6-10位字母和数字组成"></div>
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">

            <input type="button" value="isValid" onclick="isValid()">
            <input type="button" value="getAddData" onclick="getAddData()">
            <input type="button" value="getEditData" onclick="getEditData()">
            <input type="button" value="getQueryData" onclick="getQueryData()">
            <input type="button" value="setValue" onclick="setValue()">
            <input type="button" value="getValue" onclick="getValue()">
        </div>
    </div>
</form>

<script type="text/javascript" src="/lib/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/lib/layer/layer.js"></script>

<script type="text/javascript" src="/lib/handlebars/handlebars-v4.0.5.js"></script>
<script type="text/javascript" src="/lib/handlebars/handlebars-extend.js"></script>

<link href="/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<script type="text/javascript" src="/lib/bootstrap/js/bootstrap.min.js"></script>

<script type="text/javascript"  src="/lib/common/common.js"></script>

<link type="text/css" href="/lib/component/css/cc.css" rel="stylesheet" />
<script type="text/javascript"  src="/lib/component/js/cc.js"></script>

<script type="text/javascript">

    _$.parser.onComplete = function(){
        logger("---------------")
    };

    function isValid(){
        var form = new _$.Form("#form");
        var flag = form.isValid();
        if(flag){
            alert(flag)
        }

    }
    function getAddData(){

        var form = new _$.Form("#form");
        var values = form.getAddData();
        alert(JSON.stringify(values))
    }
    function getEditData(){

        var form = new _$.Form("#form");
        var values = form.getEditData();
        alert(JSON.stringify(values))
    }
    function getQueryData(){
        var form = new _$.Form("#form");
        var values = form.getQueryData();
        alert(JSON.stringify(values))
    }

    function setValue(){
        var name = _$.getById("name");
        name.setValue("fffffffff");
    }
    function getValue(){
        var name = _$.getById("name");
        var str = name.getValue();
        alert(str)
    }

    $(function(){
       _$.parser.parse()
    });

</script>
</body>
</html>
